﻿using System;

namespace Security.Domain
{
    internal static class Strings
    {
        private static readonly string getDepartmentDescription;
        private static readonly string getDatabaseLoginDescription;
        private static readonly string getLoginDescription;
        private static readonly string getPermissionDescription;
        private static readonly string getEmployeedescription;
        private static readonly string getPostDescription;
        private static readonly string getCounterpartyDescription;

        static Strings()
        {
            getDepartmentDescription = "Отдел: Name = {0}, Id = {1}";
            getDatabaseLoginDescription = "Имя входа: Name = {0}";
            getLoginDescription = "Имя входа сотрудника: Name = {0}, IDEmployee = {1}, Main = {2}, Expire = {3}";
            getPermissionDescription = "Разрешение обьекта: Name = {0} Id = {1}";
            getEmployeedescription = "Сотрудник: Id = {0}, Lastname = {1}, Post = {2}, Department = {3}";
            getPostDescription = "Должность: Id = {0}, Name = {1}";
            getCounterpartyDescription = "Контрагент: Id={0}, Name={1}";
        }

        public static string GetDepartmentDescription(Department department)
        {
            return string.Format(getDepartmentDescription, department.Name, department.ID);
        }

        public static string GetDatabaseLoginDescription(ServerLogin serverLogin)
        {
            return string.Format(getDatabaseLoginDescription, serverLogin.Name);
        }

        public static string GetLoginDescription(LoginEmployee loginEmployee)
        {
            return string.Format(getLoginDescription, loginEmployee.Login, loginEmployee.IDEmployee, loginEmployee.Main, loginEmployee.Expire);
        }

        public static string GetPermissionDescription(Permission permission)
        {
            return string.Format(getPermissionDescription, permission.Name, permission.ID);
        }

        public static string GetEmployeedescription(Employee employee)
        {
            return string.Format(getEmployeedescription, employee.ID, employee.Lastname, employee.Post, employee.Department);
        }

        public static string GetPostDescription(Post post)
        {
            return string.Format(getPostDescription, post.ID, post.Name);
        }

        public static string GetCounterpartyDescription(Counterparty counterparty)
        {
            return string.Format(getCounterpartyDescription, counterparty.ID, counterparty.Name);
        }
    }
}